﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;

public class JinBi : MonoBehaviour {

    public void Fly()
    {
        StopAllCoroutines();
        StartCoroutine(IEFly());
    }

    IEnumerator IEFly()
    {
        transform.DORotate(new Vector3(0f, 1440f, 0f), 2f, RotateMode.FastBeyond360);
        yield return new WaitForSeconds(1f);
        transform.DOMove(new Vector3(3.7f, 16f, 6.3f), 1f);
        yield return new WaitForSeconds(1f);
        Message m = new Message(MsgType.JinBiPlusPlus);
        m.send();
        Destroy(this.gameObject);
    }
}
